#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
    int x[1005];
    int y[1005];
    //freopen("in.txt","r",stdin);
    int n;
    double ans[4] = {0};
    scanf("%d",&n);
    for(int i = 0; i < n ; i++)
    {
        scanf("%d",&x[i]);
    }
    for(int i = 0; i < n ; i++)
    {
        scanf("%d",&y[i]);
    }
    for(int i = 0; i < n; i++)
    {
        ans[0] += abs(x[i] - y[i]);
        ans[1] += (x[i] - y[i]) * (x[i] - y[i]);
        ans[2] += fabs((x[i] - y[i]) * (x[i] - y[i]) * (x[i] - y[i]));
        ans[3] = ans[3] < abs(x[i] - y[i]) ? abs(x[i] - y[i]) : ans[3];
    }
    printf("%.6f\n%.6f\n%.6f\n%.6f\n",ans[0],sqrt(ans[1]),pow(ans[2],1.0/3),ans[3]);
}